﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:System="clr-namespace:System;assembly=mscorlib"
	xmlns:ViewOn="clr-namespace:ViewOn.UI.Control"
	xmlns:wpf="clr-namespace:ViewOnCore.Helper.WPF;assembly=ViewOnCore"
    xmlns:host="clr-namespace:ViewOnCore.HostContract;assembly=ViewOnCore"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">

	<Style x:Key="Slider.PositionWithEffect4.Button" TargetType="{x:Type RepeatButton}">
		<Setter Property="SnapsToDevicePixels" Value="true"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Border Background="Transparent" />
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="Slider.PositionWithEffect4.Thumb" TargetType="{x:Type Thumb}">
		<Setter Property="SnapsToDevicePixels" Value="true"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Height" Value="14"/>
		<Setter Property="Width" Value="14"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Thumb}">
					<Border
								  x:Name="Ellipse"
								  CornerRadius="0,0,0,0"
								  Background="{DynamicResource VOColorIcon}"
								  RenderTransformOrigin="0.5,0.5" Width="6" Height="6" >
						<Border.RenderTransform>
							<TransformGroup>
								<ScaleTransform ScaleX="1" ScaleY="1"/>
								<SkewTransform AngleX="0" AngleY="0"/>
								<RotateTransform Angle="45"/>
								<TranslateTransform X="0" Y="0"/>
							</TransformGroup>
						</Border.RenderTransform>
						<Border.BitmapEffect>
							<OuterGlowBitmapEffect GlowColor="{Binding Source={x:Static host:Host.UIService}, Path=GlowColors.VOGColor1A}" GlowSize="3" Noise="0" Opacity="0.5" />
						</Border.BitmapEffect>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="Ellipse" Property="Background" Value="{DynamicResource VOColor02}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<ControlTemplate x:Key="Slider.PositionWithEffect4.HorizontalSlider" TargetType="{x:Type Slider}">
		<Grid>
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			<TickBar
			  x:Name="TopTick"
			  SnapsToDevicePixels="True"
			  Placement="Top"
			  Fill="Transparent"
			  Height="4"
			  Visibility="Collapsed" />
			<Border
			  x:Name="TrackBackground"
			  Margin="0"
			  CornerRadius="2"
			  Height="1"
			  Grid.Row="1"
			  Background="{DynamicResource VOColorIcon}"
			  BorderBrush="{DynamicResource VOColorIcon}"
			  BorderThickness="1">
				<Border.BitmapEffect>
					<OuterGlowBitmapEffect GlowColor="{Binding Source={x:Static host:Host.UIService}, Path=VOGColor1A}" GlowSize="3" Noise="0" Opacity="0.5" />
				</Border.BitmapEffect>
			</Border>
			<Track Grid.Row="1" x:Name="PART_Track">
				<Track.DecreaseRepeatButton>
					<RepeatButton
					Style="{StaticResource Slider.PositionWithEffect4.Button}"
					Command="Slider.DecreaseLarge"/>
				</Track.DecreaseRepeatButton>
				<Track.IncreaseRepeatButton>
					<RepeatButton
					Style="{StaticResource Slider.PositionWithEffect4.Button}"
					Command="Slider.IncreaseLarge"/>
				</Track.IncreaseRepeatButton>
				<Track.Thumb>
					<Thumb Style="{StaticResource Slider.PositionWithEffect4.Thumb}" />
				</Track.Thumb>
			</Track>
			<TickBar
			  x:Name="BottomTick"
			  SnapsToDevicePixels="True"
			  Grid.Row="2"
			  Fill="{TemplateBinding Foreground}"
			  Placement="Bottom"
			  Height="4"
			  Visibility="Collapsed"/>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="TickPlacement" Value="TopLeft">
				<Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
			</Trigger>
			<Trigger Property="TickPlacement" Value="BottomRight">
				<Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
			</Trigger>
			<Trigger Property="TickPlacement" Value="Both">
				<Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
				<Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>

	<Style x:Key="Slider.PositionWithEffect4" TargetType="{x:Type Slider}">
		<Setter Property="SnapsToDevicePixels" Value="true"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Style.Triggers>
			<Trigger Property="Orientation" Value="Horizontal">
				<Setter Property="MinWidth" Value="30" />
				<Setter Property="MinHeight" Value="21" />
				<Setter Property="Template" Value="{StaticResource Slider.PositionWithEffect4.HorizontalSlider}" />
			</Trigger>
		</Style.Triggers>
	</Style>

</ResourceDictionary>